<!-- 展开收起 -->
<template>
    <div class="icon" @click="toggoCollapseFn">
        <i v-if="!collapse" class="el-icon-s-fold"></i>
        <i v-else class="el-icon-s-unfold"></i>
    </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex';
export default {
    data() {
        return {};
    },
    computed: {
        ...mapState('extends/collapse', ['collapse'])
    },
    methods: {
        ...mapMutations('extends/collapse', ['toggoCollapse', 'toggoSlideMenuWidth']),

        // 展开收起
        toggoCollapseFn() {
            this.toggoCollapse();
            this.toggoSlideMenuWidth();
        },
    }
}

</script>
<style lang='less' scoped>
.icon {
    font-size: 18px;
    color: #515a6e;
    cursor: pointer;

    &:hover {
        color: #409EFF;
    }
}
</style>